﻿using UnityEngine;
using System.Collections;

public class ARObjManager : MonoBehaviour
{
	
	
	int currentObjIndex = 1;
	// Use this for initialization
	void Start ()
	{
	
	}
	
	// Update is called once per frame
	void Update ()
	{
		
	}
	
	void RestartShake ()
	{
		currentObjIndex = Random.Range (1, 6);
	}
	
	
	void FoundTarget (string str)
	{
		if (str == "1") {
			for (int i=0; i<this.transform.childCount; i++) {
				Destroy (this.transform.GetChild (i).gameObject);
			}
			GameObject tmp = (GameObject)Instantiate (Resources.Load ("ModelsPrefabs/" + currentObjIndex.ToString ()));
			tmp.transform.parent = this.transform;
		} else {
			for (int i=0; i<this.transform.childCount; i++) {
				Destroy (this.transform.GetChild (i).gameObject);
			}
		}
	}
}
